package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;


@Mapper
public interface UserMapper {
    /**
     * 根据openid查询数据
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);
    /**
     * 插入数据
     * @param user
     */
    void insert(User user);

    /**
     * 根据条件统计用户数量
     * @param map
     * @return
     */
  //  @Select("select count(id) from user where create_time > #{endTime}")
    Integer sumByMap(Map map);
    /**
     * 根据日期统计用户数量
     * @param begin
     * @param end
     * @return
     */
  //  @Select("select count(id) from user where create_time > #{begin} and create_time < #{end}")
    Integer countByMap(Map map);
}
